Skip to main content

A framework for machine learning on Apple silicon.

Project description

MLX

Quickstart | Installation | Documentation | Examples

CircleCI

MLX is an array framework for machine learning on Apple silicon, brought to you by Apple machine learning research.

Some key features of MLX include:

  • Familiar APIs: MLX has a Python API that closely follows NumPy. MLX also has fully featured C++, C, and Swift APIs, which closely mirror the Python API. MLX has higher-level packages like mlx.nn and mlx.optimizers with APIs that closely follow PyTorch to simplify building more complex models.

  • Composable function transformations: MLX supports composable function transformations for automatic differentiation, automatic vectorization, and computation graph optimization.

  • Lazy computation: Computations in MLX are lazy. Arrays are only materialized when needed.

  • Dynamic graph construction: Computation graphs in MLX are constructed dynamically. Changing the shapes of function arguments does not trigger slow compilations, and debugging is simple and intuitive.

  • Multi-device: Operations can run on any of the supported devices (currently the CPU and the GPU).

  • Unified memory: A notable difference from MLX and other frameworks is the unified memory model. Arrays in MLX live in shared memory. Operations on MLX arrays can be performed on any of the supported device types without transferring data.

MLX is designed by machine learning researchers for machine learning researchers. The framework is intended to be user-friendly, but still efficient to train and deploy models. The design of the framework itself is also conceptually simple. We intend to make it easy for researchers to extend and improve MLX with the goal of quickly exploring new ideas.

The design of MLX is inspired by frameworks like NumPy, PyTorch, Jax, and ArrayFire.

Examples

The MLX examples repo has a variety of examples, including:

Quickstart

See the quick start guide in the documentation.

Installation

MLX is available on PyPI. To install MLX on macOS, run:

pip install mlx

To install the CUDA backend on Linux, run:

pip install mlx[cuda]

To install a CPU-only Linux package, run:

pip install mlx[cpu]

Checkout the documentation for more information on building the C++ and Python APIs from source.

Contributing

Check out the contribution guidelines for more information on contributing to MLX. See the docs for more information on building from source, and running tests.

We are grateful for all of our contributors. If you contribute to MLX and wish to be acknowledged, please add your name to the list in your pull request.

Citing MLX

The MLX software suite was initially developed with equal contribution by Awni Hannun, Jagrit Digani, Angelos Katharopoulos, and Ronan Collobert. If you find MLX useful in your research and wish to cite it, please use the following BibTex entry:

@software{mlx2023,
  author = {Awni Hannun and Jagrit Digani and Angelos Katharopoulos and Ronan Collobert},
  title = {{MLX}: Efficient and flexible machine learning on Apple silicon},
  url = {https://github.com/ml-explore},
  version = {0.0},
  year = {2023},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mlx-0.29.0-cp313-cp313-manylinux_2_35_x86_64.whl (645.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

mlx-0.29.0-cp313-cp313-macosx_15_0_arm64.whl (546.4 kB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

mlx-0.29.0-cp313-cp313-macosx_14_0_arm64.whl (546.4 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

mlx-0.29.0-cp313-cp313-macosx_13_0_arm64.whl (546.4 kB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

mlx-0.29.0-cp312-cp312-manylinux_2_35_x86_64.whl (645.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

mlx-0.29.0-cp312-cp312-macosx_15_0_arm64.whl (546.4 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

mlx-0.29.0-cp312-cp312-macosx_14_0_arm64.whl (546.4 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

mlx-0.29.0-cp312-cp312-macosx_13_0_arm64.whl (546.4 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

mlx-0.29.0-cp311-cp311-manylinux_2_35_x86_64.whl (650.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

mlx-0.29.0-cp311-cp311-macosx_15_0_arm64.whl (545.9 kB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

mlx-0.29.0-cp311-cp311-macosx_14_0_arm64.whl (546.0 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

mlx-0.29.0-cp311-cp311-macosx_13_0_arm64.whl (545.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

mlx-0.29.0-cp310-cp310-manylinux_2_35_x86_64.whl (650.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

mlx-0.29.0-cp310-cp310-macosx_15_0_arm64.whl (545.7 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

mlx-0.29.0-cp310-cp310-macosx_14_0_arm64.whl (545.7 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

mlx-0.29.0-cp310-cp310-macosx_13_0_arm64.whl (545.7 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

mlx-0.29.0-cp39-cp39-manylinux_2_35_x86_64.whl (650.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.35+ x86-64

mlx-0.29.0-cp39-cp39-macosx_15_0_arm64.whl (546.0 kB view details)

Uploaded CPython 3.9macOS 15.0+ ARM64

mlx-0.29.0-cp39-cp39-macosx_14_0_arm64.whl (546.0 kB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

mlx-0.29.0-cp39-cp39-macosx_13_0_arm64.whl (546.0 kB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

Details for the file mlx-0.29.0-cp313-cp313-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 adf9eeb1829ebdff5c3c406ae6b50044b766354b10218c18d5f3304520a573cd
MD5 f186393e6f28b0b202f64476e276f769
BLAKE2b-256 42ced8736d58e97e47d717cee0f1c01652aa6ca2318551683f5bd31c78d21487

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c19e722a4ae74cdcddcbe6689a2c7d019b332e2209ba4afd84d498314bba025f
MD5 50d63c5ffd5c147ace3d4072c9779cef
BLAKE2b-256 eb7a1548b82c7d41614d472b9347dca66e56a0538c773a122d88e5a7dc117605

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 471817815dd0119fe646348f173f5a23a1fb112ea97aa346d988339978e2a248
MD5 bc389bacc8dc6385f74792d7df38c198
BLAKE2b-256 26358443d8117a98b8a395723f83d4ccaae48c79e0d8a433a97213e8e51d02dc

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 5a150c6097784b6f7a688f378f93daac7d3e87b5bf3ad357af19b364cb6845b8
MD5 83e642d22d2b0b09502f77c347310d78
BLAKE2b-256 de8ec11cbbcd61b2faad5aeec78fa3d326f47438dd3eccedeecfbc25a99f889c

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 a1174dd755da6a443bd34616b6ef6bf70718648420b9efafb37d1b20d70877d0
MD5 61ff649e4c06e858a841668aa5d59ef0
BLAKE2b-256 ecdd5e1c4672a551f475b5305e3e21da808aacb080a114af83a38e5b9551c212

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 593a3d71c5859f83bc55a9bdc612fe5f8b495c14112e0e7a96c027c11ce5ab52
MD5 57c85933723e18fca7ba71c1d210e1f9
BLAKE2b-256 854032b1fe76d80f559ff3af18d104a22c4d07ecad62a88e3c313083722868e4

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 446ea784a4717c9b06eee9c91ee038245ebb231760a2cf61b677dc3d256cbd83
MD5 d6badf72496801575d19c2dd892cf071
BLAKE2b-256 61c79f6a5cf1a0b0eb1ace3892c930f64fa84351cecc75221ce4ca5abd0ad64d

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a9f9f760a179d96fa7fecc0b31a9885a9ab4ce9e2914f7f34c2980edd7f012fa
MD5 ea21e03e51edb5f2b060e2be3ce99691
BLAKE2b-256 60c0a95f24f4b78fdf96f57aaa1a8919f5688603fd4fa0294c2f868f60bc98af

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 6f2f969c6ad6259f4422c7cd7bfcb49705679585991109220de0b758feaedc25
MD5 c82d2239beff4e72b6bf1a5d6f73ef42
BLAKE2b-256 9a57d1d0cdd5d194ec8b7b55062407d8e04bcdf62de73c2ef0db075fba0ce7f3

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7800f87fc5eb9861c6444b0bb38175c8f0b12d48746a980264fe744f6eb53a50
MD5 60b0683ab58105ee4560a6860e074f73
BLAKE2b-256 dea3337461b75168cf701a1190eabd331de4fb752dc9dc5759fbede76f744aab

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 05c390811f6514013535b5fea9fa33b63daa8cdc17881deadca7fbca38e42c93
MD5 fb7dca9cd33830b33ded23b3061ad80d
BLAKE2b-256 5700277ba0f1f384275d122b0af4ebc5866a452689e3b0144d03b46a549a7142

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 96d49e76a152a202c146ce4b71538b59c9eb6c98b40557ee26a3cf9753b5fb34
MD5 2bf24227cab29c91eee1ae59463cad7c
BLAKE2b-256 00b3490ae792034a95895a70d04feadb1158786d96605a45555c1cae0a1158d3

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 03a738104b50c38e939ba8037b6a04ee937ebd4e77a9792f1f922d021cad0010
MD5 7364c2d7a9fa9b918ad98fb600cfe5fd
BLAKE2b-256 d103d5186edf170e7866c4bf37baa50c8e0fc26b6d8668f9fa79f34d23e66ed6

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4e055878e54afb6ac258c145674d59682c8c565e3fd1dde5e28ca3ebc52d3434
MD5 dd26c7e8fb8cdecfe633b0b756b7cfa7
BLAKE2b-256 114290b5d0d52ed733b57de7fbde2d972ecd20b819553a36bd8a4b78750539d6

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 afe33a3feefc62622bc71dd10c4e7e75bc8278780351fd82f1c33145b072d88b
MD5 acae4253c48e6d3b38c37e9aeb6a25b6
BLAKE2b-256 3b773c6d307c62cec555c2c6e81a978b41c3db9d1244653578df6159c7872ef8

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for mlx-0.29.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 430b85d5444247b80417fd3a2b966676af43549f0926095bac25866b2154c9f0
MD5 b0c4914635cad568bd33983b70e8f6f7
BLAKE2b-256 cb13da859e935a0f4179c4e599afe9f4add8d594e0433ac131460746f6a7cbdf

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp39-cp39-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: mlx-0.29.0-cp39-cp39-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 650.3 kB
  • Tags: CPython 3.9, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.29.0-cp39-cp39-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 ce2a1efc3556cfa2ad99ae17191c352a94648ab1f8ec22d370a94709f428de5b
MD5 3066a6820425c0d95ba502d6063cbcb7
BLAKE2b-256 371ad10424c2ffdb7cdc6b1cccda7763d5b72b5ddb6483d8d32206fd76053e04

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp39-cp39-macosx_15_0_arm64.whl.

File metadata

  • Download URL: mlx-0.29.0-cp39-cp39-macosx_15_0_arm64.whl
  • Upload date:
  • Size: 546.0 kB
  • Tags: CPython 3.9, macOS 15.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.29.0-cp39-cp39-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b883d3546bc1ef2484c9350ef04bbec685bda8e78f37a81b0520f7dbc5de369b
MD5 27589484181075751f0dedc3d0a140c0
BLAKE2b-256 9f1653d7ad4e9b7d2c990440ea1574b2d1ddf8fae3af6c6c78596fd8ed2088d3

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

  • Download URL: mlx-0.29.0-cp39-cp39-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 546.0 kB
  • Tags: CPython 3.9, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.29.0-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 b21447542d4082b9de5dfc14253a09574b9df6518133b38d111afbd68457b2e7
MD5 c1ec86f7745a8fcaf9f5a47659078a69
BLAKE2b-256 78235d2929d048eaa12caab2c38936e96205c174dd919bc6db835ab55b3526cb

See more details on using hashes here.

File details

Details for the file mlx-0.29.0-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

  • Download URL: mlx-0.29.0-cp39-cp39-macosx_13_0_arm64.whl
  • Upload date:
  • Size: 546.0 kB
  • Tags: CPython 3.9, macOS 13.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for mlx-0.29.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e5b3aa72b8ab380e131189427275b8fa0a292bd96f7389d847915a621697824e
MD5 449ab95ffa8c9e9d7aa4fdab3884822a
BLAKE2b-256 ea781526222cb0fbb9a3ed53493416259c8816bbccb59e9c0ac72bbaa3b00731

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page